<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><!-- #BeginTemplate "/Templates/method.dwt" -->
<head>
<!-- #BeginEditable "doctitle" --> 
<title>WIKINDX CLASS DOCUMENTATION</title>
<!-- #EndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="/wikindx2/docs/docs.css" type="text/css" />
</head>

<body bgcolor="#FFFFFF" text="#000000">
<h2>WIKINDX METHODS</h2>
<p><strong>Method:</strong><br />
  <!-- #BeginEditable "methodName" -->
  text()
  <!-- #EndEditable -->
  </p>
<p><strong>Class:</strong><br />
<!-- #BeginEditable "className" -->
<a href="errorsClass.html">ERRORS</a><br />
or<br />
<a href="messagesClass.html">MESSAGES</a>
<!-- #EndEditable -->
<p><strong>Method Call:</strong><br />
  <!-- #BeginEditable "methodCall" -->
include_once("core/messages/ERRORS.php");<br />
$message = new ERRORS();<br />
OR<br />
include_once("core/messages/MESSAGES.php");<br />
$message = new MESSAGES();<br />
  STRING $message->text(STRING: $arrayName, STRING: $indexName, [STRING: $extra]);
  <!-- #EndEditable -->
  </p>
<strong>Description:</strong><br />
  <!-- #BeginEditable "methodDescription" -->
Called via one of several classes within core/messages/, this method will return a properly formatted error message, 
text message etc. that has been selected from an array of strings within that class depending on the language chosen at 
setup.  The string returned is parsed by PHP's htmlspecialchars() function.

<p>$arrayName is the name of the selected array and $indexName is the key of a particular element in that array. The 
optional $extra is a string that provides more specific information on the error/message and is included in the 
formatted return string.</p>


<!-- #EndEditable -->
<strong>Usage:</strong><br />
  <!-- #BeginEditable "methodUsage" -->
For example, if <i>ERROR::en()</i> has an array called <i>inputError</i> consisting of the following:

<pre>
	array(
		"nan"		=>	"### is not a number.",
		"missing"	=>	"Missing input.###",
		"invalid"	=>	"Invalid input.###",
	);
</pre>

then

<pre>
	include_once("core/messages/ERRORS.php");
	$error = new ERRORS();
	$pString = $error->text("inputError", "missing", " (Superadmin Password) ");</pre>
	
will return the formatted string:

<pre>
	Missing input. (Superadmin Password)</pre>

<p>(Any occurrence of '###' in the array element value is replaced by the optional string $extra or "" if $extra does 
not exist.)</p>
<!-- #EndEditable -->
<p align="right"><a href="../../index.html">WIKINDX home</a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a href="../../usage/index.html">WIKINDX usage</a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a href="../index.html">WIKINDX classes</a>
</p>
  </body>
<!-- #EndTemplate -->
</html>
